home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Programming / Source / HippoDraw / HippoDrawSrc1.1 / Hippo.subproj / HTuple.h < prev    next >
Encoding:
Text File  |  1992-04-25  |  3.6 KB  |  143 lines

  1. /* HTuple.h    by Paul Kunz    December 1991
  2.  * Object used to store information on open Hippo Tuple and methods
  3.  * to archive it to NXTypedStream.
  4.  *
  5.  * $Id: HTuple.h,v 1.6 1992/04/13 20:43:55 pfkeb Rel $
  6.  *
  7.  * Copyright (C)  1991  The Board of Trustees of
  8.  * The Leland Stanford Junior University.  All Rights Reserved.
  9.  */ 
  10.  
  11. #import <objc/Object.h>
  12.  
  13. #import <stdio.h>
  14. #import "hippo.h"
  15.  
  16. @interface HTuple:Object
  17. {
  18.     ntuple    tuple;        /* The tuple */
  19.     char     *filename;    /* filename of ntuple */
  20.     int        ntindex;    /* index of tuple in file */
  21.     char     *altfilename;    /* alternate filename of ntuple */
  22.     BOOL    isRef;        /* Import by reference or not */
  23.     BOOL    isBinary;    /* file was binary or not */
  24.     BOOL    fakeFilename;    /* set YES if n-tuple is not from file */
  25. }
  26. + initialize;
  27.  /*
  28.   * Initializer for class.   Sets up the class version number 
  29.   */
  30.   
  31. - initTuple:(ntuple) nt file:(const char *)path
  32.          by:(BOOL)refFlag mode:(BOOL) binFlag index:(int) iValue;
  33.  /*
  34.   * Designated initalizer fro HTuple object.
  35.   */
  36.   
  37. - (ntuple) ntuple;
  38.  /*
  39.   * Returns the ntuple managed by the receiving object.
  40.   */
  41.   
  42. - setNtuple:(ntuple) aTuple;
  43.  /*
  44.   * Sets the ntuple to be managed by the receiving object.
  45.   */
  46.   
  47. - (BOOL) isRef;
  48.  /*
  49.   * Returns YES if ntuple is imported by reference, or NO otherwise.
  50.   */
  51.   
  52. - setIsRef:(BOOL) refFlag;
  53.  /*
  54.   * Sets the reference state of the ntuple managed by receiving object.
  55.   */
  56.   
  57. - (BOOL) isSameAs:aTuple;
  58.  /*
  59.   * The receiving object compares its self with aTuple and returns
  60.   * YES if both objects refer to the same ntuple.
  61.   */
  62.   
  63. - setIsBinary:(BOOL) binFlag;
  64.  /*
  65.   * Sets the mode by which the ntuple was read from disk to binary,
  66.   * binFlag = YES, or text, binFlag = NO.
  67.   */
  68.   
  69. - (const char *)filename;
  70.  /*
  71.   * Returns the file name of the ntuple managed by the receiving object.
  72.   */
  73.   
  74. - setFilename:(const char *)path;
  75.  /*
  76.   * Sets the filename path name of the ntuple managed by the receiving object.
  77.   */
  78.   
  79. - (int) index;
  80.  /*
  81.   * Returns the index number of n-tuple in a file of multiple n-tuples.
  82.   */
  83.   
  84. - setIndex:(int) value;
  85.  /*
  86.   * Sets the index number of n-tuple in a file of multiple n-tuples.
  87.   */
  88.   
  89. - (const char *)altfilename;
  90.  /*
  91.   * Returns the alternate file name of the ntuple managed 
  92.   * by the receiving object.  In cases where the object was archived
  93.   * by reference with one file name, but upon dearchiving another
  94.   * filename was prompted for and used, then the alternate filename
  95.   * is the original filename.
  96.   */
  97.   
  98. - setAltFilename:(const char *)path;
  99.  /*
  100.   * Sets the alternate filename path name of the ntuple managed 
  101.   * by the receiving object. See - (const char *)altfilename.
  102.   */
  103.   
  104. - (BOOL) isFakeFilename;
  105.  /*
  106.   * Returns YES if the filename is a fake one.
  107.   */
  108.  
  109. - setFakeFilename:(BOOL) bValue;
  110.  /*
  111.   * Sets the status of the filename.   The filename is considered "fake"
  112.   * if the n-tuple was not read from a file, e.g. was copied from Pasteboard
  113.   * or generated by the application.
  114.   */
  115.   
  116. - (const char *) title;
  117.  /*
  118.   * Returns the title of the tuple if it is open, else non available 
  119.   * message.
  120.   */
  121.   
  122. - write:(NXTypedStream *) stream;
  123.  /*
  124.   * Archives the receiving object to the NXTypedStream stream.   If
  125.   * the ntuple managed by the receiving object is imported by copy,
  126.   * then the ntuple is archived as well
  127.   */
  128.   
  129. - read:(NXTypedStream *) stream;
  130.  /*
  131.   * Dearchives the receiving object from the NXTypedStream stream.   If
  132.   * the ntuple managed by the receiving object is imported by copy,
  133.   * then the ntuple is dearchived as well.
  134.   */
  135.   
  136. - free;
  137.  /*
  138.   * Frees all memory contained by the receiving object and
  139.   * frees the object itself.
  140.   */
  141.   
  142. @end
  143.